1. Field of the Invention
The present invention relates to a program storage type microcomputer used in, e.g., an IC card.
2. Description of the Related Art
Among recent microcomputers, a microcomputer which incorporates a program ROM, a working RAM, and the like and allocates these memories and an external memory in the same memory space, is known. For example, in a microcomputer for accessing a 64-kbyte memory space, when the microcomputer has a 16-kbyte internal ROM, a 1-kbyte internal RAM, and a 32-kbyte external memory is used, these memories are allocated in the 64-kbyte address space without overlapping their addresses. In this case, an address and data buses are supplied from the ROM, the RAM, and the external memory, respectively.
In a conventional microcomputer, data read out from internal ROM and RAM are directly output to an external device. For this reason, ROM and RAM contents are easily recognized externally.
In particular, in a microcomputer built in an IC card or the like for which security is of prime importance, an internal ROM stores a control program. Therefore, if the program data is easily detected externally, security of the entire system suffers. In addition, a counterfeit IC card is easily manufactured.
A recent microcomputer includes a volatile memory such as a RAM as a working memory which is necessary during execution of the program. An operation of such a microcomputer, in particular, all the cell of a RAM cannot be easily confirmed. Therefore, a microcomputer has a function of writing a specific pattern and verifying and checking the pattern. However, this method does not allow perfect confirmation of the RAM operation. Therefore, when the microcomputer is easily replaceable, a test program of the RAM is input in a program of the microcomputer in advance, so that the operation of the RAM can be confirmed upon adjustment of a device which includes the microcomputer. As a result, the operation of the RAM need not be perfectly confirmed when the microcomputer is shipped.
According to the method as described above, however, a device which does not allow replacement of a microcomputer upon assembly, such as an IC card, has the following disadvantage. That is, even if an abnormality is detected in the operation of the RAM, the microcomputer cannot be replaced. Therefore, yield of IC cards is reduced, and reliability of IC cards is degraded. Therefore, in particular, when a microcomputer used as a control element of an IC card is shipped or before it is molded in the IC card, the operation of the RAM must be perfectly confirmed.